<!--
 * @Author: your name
 * @Date: 2022-01-11 17:55:22
 * @LastEditTime: 2022-01-12 04:44:31
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \campus-market-frontend-master\src\pages\usercenter.vue
-->
<route lang="yaml">
meta:
  requiresAuth: true
</route>
<template>
  <el-container>
    <el-header><Header></Header></el-header>
    <el-main>
      <el-card class="usermsglist">
        <el-container>
          <el-aside width="200px">
            <el-menu default-active="1" class="el-menu-vertical-demo">
              <el-menu-item index="1" @click="showusermsg">
                <span>用户信息</span>
              </el-menu-item>
              <el-menu-item index="2" @click="showorderform">
                <span>订单信息</span>
              </el-menu-item>
              <el-menu-item index="3" @click="showpublishform">
                <span>发布的商品</span>
              </el-menu-item>
              <el-menu-item index="4" @click="showdemandform">
                <span>发布的求购</span>
              </el-menu-item>
              <el-menu-item index="5" @click="showAddress">
                <span>收货地址</span>
              </el-menu-item>
              <el-menu-item index="6" @click="showhistoryform">
                <span>历史记录</span>
              </el-menu-item>
              <el-menu-item index="7" @click="showfavoriteform">
                <span>我的收藏</span>
              </el-menu-item>
            </el-menu>
          </el-aside>
          <el-main class="main2">
            <router-view></router-view>
          </el-main>
        </el-container>
      </el-card>
    </el-main>
    <el-footer><Footer></Footer></el-footer>
  </el-container>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import Footer from '../components/footer.vue'
import Header from '../components/header.vue'
const router = useRouter()
function showusermsg() {
  router.push('/usercenter/profile')
}
function showhistoryform() {
  router.push('/usercenter/history')
}
function showorderform() {
  router.push('/usercenter/orderform')
}
function showfavoriteform() {
  router.push('/usercenter/favoriteitem')
}
function showpublishform() {
  router.push('/usercenter/publishItem')
}
function showdemandform() {
  router.push('/usercenter/demanditem')
}
function showAddress() {
  router.push('/usercenter/address')
}
</script>

<style lang="less" scoped>
.el-container {
  height: 500px;
}
.el-main {
  overflow: inherit;
  .usermsglist {
    margin: 30px 50%;
    width: 1000px;
    height: 1000px;
    transform: translateX(-50%);
  }
}
.el-header {
  padding: 0;
  background-color: white;
  position: relative;
  z-index: 999;
  box-shadow: 0px -5px 10px #1a1919;
}
.el-footer {
  padding: 0;
}
</style>
